home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / softwareupdate / system / amigados / amigadoslibrary / ioerr.c < prev    next >
C/C++ Source or Header  |  1996-10-10  |  876b  |  41 lines

  1. /* IoErr.c   V1.0   93-09-26                        */
  2. /* ROM library: "dos.library/IoErr", (All versions) */
  3. /* Copyright 1993, Anders Bjerin, Amiga C Club      */
  4.  
  5. #include <dos/dos.h>
  6.  
  7. #include <clib/dos_protos.h>
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10.  
  11. UBYTE *version = "$VER: IoErr 1.0";
  12.  
  13. int main( int argc, char *argv[] );
  14. int main( int argc, char *argv[] )
  15. {
  16.   /* Store the error code here: */
  17.   LONG error_code;
  18.  
  19.  
  20.   /* Collect the global error code: */
  21.   error_code = IoErr();
  22.  
  23.   /* Print the error code: */
  24.   printf( "Error code: %d - ", error_code );
  25.  
  26.   /* Examine the error code: */  
  27.   switch( error_code )
  28.   {
  29.     case ERROR_NO_FREE_STORE: printf( "Out of memory!\n" ); break;
  30.     case ERROR_TASK_TABLE_FULL: printf( "To many processes running!\n" ); break;
  31.  
  32.     /* and so on... */
  33.  
  34.     default:
  35.       printf( "Unknown error reported!\n" );
  36.   }
  37.  
  38.   exit( 0 );
  39. }
  40.  
  41.